<?php
/**
 * 前台文章模型
 * 结合关联模型
 */
import('RelationModel');
class AlbumModel extends RelationModel{

  /**
   * 与评论,栏目,标签关联定义
   */
  protected $_link=array(
   'Comment'=>array(
      'mapping_type'=>HAS_MANY,
      'class_name'=>'Comment',
      'mapping_name'=>'Comment',
      'foreign_key'=>'value_id',
      'condition'=>"source='Album' AND status=1",
      'mapping_fields'=>'count(id) as cmtNum'
     )   
  );

}
?>